﻿using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SQLite;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string key = Request.QueryString.Get("key");

        string cmd = String.Format("select dt from User where key = '{0}'", key);

        DataTable dt = Query(cmd);


    }

    public static SQLiteConnection CreateConnection()
    {
        return new SQLiteConnection("");
    }

    public static DataTable Query(string cmd)
    {
        DataTable dt = new DataTable();

        using (SQLiteConnection con = CreateConnection())
        {
            using (SQLiteDataAdapter da = new SQLiteDataAdapter(cmd, con))
            {
                try
                {
                    da.Fill(dt);
                }
                catch (SQLiteException)
                {
                    return null;
                }
            }
        }

        return dt;
    }
}
